import React, { Component } from 'react'
import { Text, StyleSheet, View } from 'react-native'
import WebView from 'react-native-webview'

class Detail extends Component {
  constructor(props) {
    super(props)

    // console.log(props)
    // 获取路由传参
    this.url = this.props.route.params.url;
  }

  componentDidMount() {
    // 设置 header 选项内容
    // this.props.navigation.setOptions({
    //   title: this.props.route.params.title
    // });

    // this.props.navigation.addListener('focus', () => {
    //   alert('Header 获取焦点')
    // });
  }
  

  render() {
    return (
      <WebView
        source={{uri: this.url}}
      />
    )
  }
}

export default Detail
